﻿using System;
using System.Collections.Generic;
using System.Text;
using Watchdog.Dal;
using Watchdog.Bll;
using Watchdog.Bll.Base;

namespace Watchdog.Bll.Factory {

    public partial class TargetDeviceFactory {
        public static void Delete ( TargetDeviceBase targetdevice ) {
            DataClient.Current.TargetDeviceDelete ( targetdevice.IntData );
        }

        public static List<TargetDevice> GetByTest ( int test ) {
		    List<TargetDevice> outlist = new List<TargetDevice> ();
            Watchdog.Facade.TargetDevice[] list = Dal.DataClient.Current.TargetDeviceGetByTest ( test );
            foreach (Watchdog.Facade.TargetDevice item in list)
                outlist.Add (new TargetDevice (item));
            return outlist;
            // return DataClient.Current.TargetDeviceGetByTest ( test );
        }
        public static List<TargetDevice> GetByTestDevice ( int testdevice ) {
		    List<TargetDevice> outlist = new List<TargetDevice> ();
            Watchdog.Facade.TargetDevice[] list = Dal.DataClient.Current.TargetDeviceGetByTestDevice ( testdevice );
            foreach (Watchdog.Facade.TargetDevice item in list)
                outlist.Add (new TargetDevice (item));
            return outlist;
            // return DataClient.Current.TargetDeviceGetByTestDevice ( testdevice );
        }
        public static void Insert ( TargetDeviceBase targetdevice ) {
            targetdevice.IntData = DataClient.Current.TargetDeviceInsert ( targetdevice.IntData );
        }
		
        public static void Update ( TargetDeviceBase targetdevice ) {
            DataClient.Current.TargetDeviceUpdate ( targetdevice.IntData );
        }
		
	}
}
